<?php

/*
*/

class User_Right_model extends CI_Model
{

	private $rights;
	static $TABLE;

	function __construct()
	{
		parent::__construct();

		//选择数据库
		$this->load->library('test_database');
		$this->test_database->test();
		$this->load->database($this->test_database->get_db());

		//初始化参数
		$this->rights = array();
		$this->TABLE = 'users_rights';
	}

	/***
	For private function here
	***/


	/***
	For public function here
	***/
	public function get_rights($user_id, $select='*')
	{
		if ($query = $this->db->where('user_id', $user_id)->get($this->TABLE))
		{
			$this->rights = $query->result_array();
			return TRUE;
		}
		else
		{
			$this->error = 'SQL_ERR';
		}
		return FALSE;
	}

	public function rights()
	{
		return $this->rights;
	}

}